package com.example.spring_security.controller;

/**
 * @Description securityConfig2 配套测试
 * @Author lihw
 * @Date 2024/5/28 14:04
 */
// @RequestMapping("/api/v1/login")
// @RestController
public class LoginController {

    // private final AuthenticationManager authenticationManager;

    // public LoginController(AuthenticationManager authenticationManager) {
    //     this.authenticationManager = authenticationManager;
    // }
    //
    // @PostMapping
    // public ResponseEntity<String> login(@RequestBody LoginRequest loginRequest) {
    //     Authentication authenticationRequest =
    //             UsernamePasswordAuthenticationToken.unauthenticated(loginRequest.username(), loginRequest.password());
    //     Authentication authenticationResponse =
    //             this.authenticationManager.authenticate(authenticationRequest);
    //
    //     // ...
    //     return ResponseEntity.ok("success");
    // }

    public record LoginRequest(String username, String password) {
    }

}
